home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #6 / utv1n6s1.d64 / wall street wiz (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  9.2 KB  |  302 lines

  1. 0 ifa=0thena=1:load"0:wiz.ml",8,1
  2. 5 poke55,0:poke56,128:clr
  3. 10 rem(c)1987 uptime by softdisk publishing, inc
  4. 11 print"[147]":clr
  5. 13 sys52945
  6. 15 poke53280,0:poke53281,0:poke54273,25:poke54277,9:poke54278,9:poke54296,15
  7. 16 poke54280,10:poke54284,2:poke54285,0:poke54275,8
  8. 20 print"[147]":clr
  9. 60 esc=0:mt=0
  10. 70 dimtc(30),ts(30),tp(30),sp(30,7),dj(30)
  11. 75 dimsn(30,7),chg(30,7),chg$(30,7),nm$(30,7)
  12. 80 tc(0)=1000000: dj(0)=2000
  13. 90 rem
  14. 95 a$="[215]all [211]treet [215]iz"
  15. 100 cn$(1)="[203][194][205]":hp$(1)=" 14":lp$(1)="  4"
  16. 105 sp(0,1)=9:ep$(1)="  .01":vg(1)=2:vb(1)=3
  17. 110 cn$(2)="[197][216][216][207][198][198]":hp$(2)=" 59":lp$(2)=" 43"
  18. 115 sp(0,2)=55:ep$(2)=" 2.50":vg(2)=2:vb(2)=4
  19. 120 cn$(3)="[213][194][205]":hp$(3)="150":lp$(3)=" 90":sp(0,3)=105
  20. 125 ep$(3)="10.00":vg(3)=2:vb(3)=5
  21. 130 cn$(4)="[215]izer":hp$(4)=" 70":lp$(4)=" 21"
  22. 135 sp(0,4)=60:ep$(4)=" 8.00":vg(4)=2:vb(4)=2.5
  23. 140 cn$(5)="[207]n[212]rax":hp$(5)=" 39":lp$(5)=" 14"
  24. 145 sp(0,5)=19:ep$(5)="  -0-":vg(5)=5:vb(5)=2.4
  25. 150 cn$(6)="[205]icro[195]hip":hp$(6)="  9":lp$(6)="  3":sp(0,6)=7
  26. 155 ep$(6)="  -0-":vg(6)=2:vb(6)=2
  27. 160 cn$(7)="[204]azer [195]orp.":hp$(7)=" 20":lp$(7)="  2"
  28. 165 sp(0,7)=10:ep$(7)=" 1.00":vg(7)=2:vb(7)=2.4
  29. 170 rem
  30. 180 mt=0:gosub920
  31. 190 d=0:nc=7:gosub1200
  32. 200 poke214,14:print"[145]":print"[200]ere is a list of stocks with the"
  33. 202 print"year's [200]igh, [204]ow, and [195]urrent prices"
  34. 205 print"and [197]arnings per [211]hare:"
  35. 210 getsh$:ifsh$=""then210
  36. 220 ifsh$=chr$(13)thengoto250
  37. 230 ifsh$="[140]"then goto 900
  38. 240 poke54276,33:poke54276,32: goto 210
  39. 250 rem
  40. 260 gosub 1400: rem  subr to buy stocks
  41. 270 rem
  42. 280 mt=2:gosub920
  43. 290 poke214,6:print"[145]":print"[212]he duration of this session of [215][193][204][204]"
  44. 292 print"[211][212][210][197][197][212] [215][201][218] is measured in days."
  45. 294 poke214,18:print"[145]":m$="[197]nter zero (0) and [[210][197][212][213][210][206]] to exit":gosub1040
  46. 300 poke214,10:print:print"[197]nter number of days (1 to 30) you'll"
  47. 302 print"be investing & press [return] -> ";:bs=1:gosub1700:dm$=wq$
  48. 304 dm=val(dm$+chr$(0)):ifasc(dm$+chr$(0))=48then:goto900
  49. 310 ifdm$=" "then290
  50. 320 if(dm<1)or(dm>30)thengosub1150:sl=21:nl=1:gosub1170:goto290
  51. 330 print"[147]":m$="[208]lease wait....."
  52. 332 gosub1040:print:m$="[212]he [215][193][204][204] [211][212][210][197][197][212] computer is working"
  53. 334 gosub1040:print:m$="on your portfolio.":gosub1040
  54. 340 ford=1todm:tc(d)=tc(d-1):ifdur>0then370
  55. 350 rn=int(1+rnd(1)*10):ifrn>4thendur=rn:goto370
  56. 360 dur=rn+6
  57. 370 dj(d)=int(dj(d-1)*(-(rn>4)*.995-(rn<5)*1.01)+10*rnd(1)-5)
  58. 375 dd=dj(d)-dj(d-1):dur=dur-1
  59. 376 forxx=1to2
  60. 377 rx(xx)=int(7*rnd(1)+1)
  61. 380 if rx(2)=rx(1)thenxx=1
  62. 390 next
  63. 400 forc=1to7:ifc=rx(1)then430
  64. 410 ifc=rx(2)then430
  65. 420 goto450
  66. 430 sn(d,c)=int(2*rnd(1)):ifsn(d,c)=0thengosub1310:goto450
  67. 440 gosub1350
  68. 450 ifsp(d-1,c)>=10then460
  69. 452 sp(d,c)=int(sp(d-1,c)*(-1.3*(dd>0)-.98*(dd<1))+(nv(c)*.5)):goto480
  70. 460 ifsp(d-1,c)<=50thengoto470
  71. 462 sp(d,c)=int(sp(d-1,c)*(-1.02*(dd>0)-.99*(dd<1))+(nv(c)*.7)):goto480
  72. 470 sp(d,c)=int(sp(d-1,c)*(-1.03*(dd>0)-.98*(dd<1))+(nv(c)*.6))
  73. 480 ifsp(d,c)<0thensp(d,c)=0
  74. 490 chg(d,c)=sp(d,c)-sp((d-1),c)
  75. 495 ifchg(d,c)<1thenchg$(d,c)=str$(chg(d,c)):goto 510
  76. 500 chg$(d,c)="+"+str$(chg(d,c)):goto520
  77. 510 if(sp((d-1),c)=0)and(chg(d,c)<0)thenchg$(d,c)="0"
  78. 520 next
  79. 530 rem
  80. 540 mt=1:gosub 920
  81. 545 print"[146]# [195]ompany [206]ame  [208]/[211]  [195]hg #[211]hrs  [212]ot [214]al"
  82. 546 tv=0:forc=1to7
  83. 550 poke214,c+3:print"[145]":printc;tab(3);
  84. 555 print"[129]"cn$(c);:h=20:a=sp(d,c):gosub1060:print"[158]"a;
  85. 557 hx=len(chg$(d,c)):printtab(25-hx)"[159]"chg$(d,c);
  86. 559 ifns(c)<1then570
  87. 560 hx=len(ns$(c)):printtab(31-hx);
  88. 565 print"[156]"ns$(c);:tv(c)=ns(c)*sp(d,c):h=39:a=tv(c):gosub1060:print""a
  89. 567 tv=tv+tv(c)
  90. 570 nextc:poke214,10:print:printtab(31)"[192][192][192][192][192][192][192]":printtab(16)"[159][196]ay #";d
  91. 572 printtab(11)"[212]otal [211]tock [214]alue =";:h=39:a=tv
  92. 575 gosub1060:printa
  93. 580 printtab(13)"[193]vailable  [195]ash =";
  94. 585 h=39:a=tc(d):gosub1060:printa
  95. 587 ifcom>0thenprinttab(11)"[211]tock commissions =";:a=com:h=39:gosub1060:printa
  96. 590 printtab(7)"[153][212]otal [208]ortfolio [214]alue =";
  97. 595 bl=tc(d)+tv:h=39:a=bl:gosub1060:printa
  98. 605 dj$="[196]ow-[202]ones [193]vg"+str$(dj(d))+"-":dd$="[206]o [195]hg"
  99. 607 print"[154]":m$="[215]all [211]t. [206]ews:  ":gosub1040
  100. 610 ifdd>0thendd$="[213]p"+str$(dd):goto630
  101. 620 ifdd<0thendd$="[196]n"+str$(abs(dd))
  102. 630 dj$=dj$+dd$:m$=dj$:uy=19-len(m$)/2:forl=1touy:m$=m$+" ":next:gosub1130
  103. 640 nm$="":r=0:forn=1to7:iflen(nm$(d,n))=0thengoto680
  104. 650 nm$=cn$(n)+nm$(d,n):r=r+1
  105. 660 iflen(nm$)<38thenforw=1to38-len(nm$):nm$=nm$+".":next
  106. 670 m$=nm$:gosub1140
  107. 680 next
  108. 690 getqw$:ifqw$=""then 690
  109. 700 ifqw$=chr$(13)then800
  110. 710 ifqw$="[140]"then900
  111. 720 ifqw$="b"orqw$="[194]"then750
  112. 730 ifqw$="s"orqw$="[211]"then770
  113. 734 ifqw$="o"orqw$="[207]"thenpoke54276,65:poke54276,64
  114. 735 if(qw$="o"orqw$="[207]")andsf=1thenpoke781,23:poke782,36:poke783,48
  115. 736 if(qw$="o"orqw$="[207]")andsf=1thensf=0:sys65520:print"[149]n [146]";:goto690
  116. 737 if(qw$="o"orqw$="[207]")andsf=0thenpoke781,23:poke782,36:poke783,48
  117. 738 if(qw$="o"orqw$="[207]")andsf=0thensf=1:sys65520:print"[149]ff[146]";:goto690
  118. 740 poke54276,65:poke54276,64:goto690
  119. 750 rem
  120. 760 gosub1400:goto530
  121. 770 rem
  122. 780 gosub1540:goto530
  123. 790 sl=16:nl=5:gosub1170:gosub4800:gosub1540:goto530
  124. 800 com=0:nextd
  125. 810 rem
  126. 820 mt=2:gosub920:print:m$="[159][201][206][214][197][211][212][205][197][206][212] [211][197][211][211][201][207][206] [210][197][208][207][210][212]"
  127. 822 gosub1040:print"[195]lient's final portfolio    [153]$";
  128. 824 h=39:a=bl:gosub1060:printbl
  129. 826 print"[195]lient's initial investment [150]$";:h=39:a=1000000:gosub1060:printa
  130. 830 printtab(31)"[192][192][192][192][192][192][192]"
  131. 832 print"[206]et gain or loss(-)[154]";
  132. 834 h=39:a=bl-1000000:gosub1060:printa
  133. 835 print"[158]";
  134. 840 if(a<-10000)or(a>10000)thengoto850
  135. 845 print"  [217]our client expected better results!":goto890
  136. 850 if(a<-10000)or(a>100000)then860
  137. 855 print" [199][207][207][196] [202][207][194]! [217]ou get a raise of $10,000!":goto890
  138. 860 ifa<-10000then870
  139. 865 print" [211][213][208][197][210]!!! [217]ou've been promoted to [214][208]!!":goto890
  140. 870 ifa<-100000then880
  141. 875 print"   [206][207][212] [212][207][207] [199][207][207][196]! [217]our boss is mad!!!!":goto890
  142. 880 print"       [217]ou could lose your job!!!"
  143. 890 print"":m$="[196]o you want to invest again?":gosub1040
  144. 892 print"       [197]nter [217] or [206] --> [166][157]";:gosub1080
  145. 894 poke204,255:printan$:ifan$="y"oran$="[217]"then20
  146. 900 rem
  147. 910 ifpeek(32768)=76andpeek(32769)=7andpeek(32770)=128andpeek(32771)=234then914
  148. 912 print"[147]":new
  149. 914 ifpeek(32772)<>76orpeek(32774)<>128then912
  150. 916 sys32772
  151. 920 rem
  152. 940 print"[147][149]$$$$$$$$$$$[146]";
  153. 942 printtab(11)" ";a$;" ";
  154. 944 printtab(29)"$$$$$$$$$$$[146]"
  155. 950 ifmt=1then990
  156. 960 ifmt=2then1010
  157. 970 ifmt=3then1000
  158. 980 poke214,24:print"[145]":print" [[198]8] to end";
  159. 985 print"       [[210][197][212][213][210][206]] to continue[146]";:poke2023,160:poke56295,9:goto1010
  160. 990 sf$="n ":ifsf=1thensf$="ff"
  161. 992 poke214,23:print"[145]"
  162. 994 print " [[194]]uy         [[211]]ell      [211]ound [[207]]";sf$;"  ";
  163. 996 print" [[198]8] to end       [[210][197][212][213][210][206]] to [195]ontinue";:poke2023,160:poke56295,9
  164. 998 goto 1020
  165. 1000 poke214,23:print"[145]"
  166. 1002 print" [esc] to end                           ";
  167. 1010 rem
  168. 1020 mt=o:return
  169. 1030 rem
  170. 1040 rem
  171. 1050 printtab(20-len(m$)/2)m$: return
  172. 1060 rem
  173. 1070 hx=len(str$(a)):printtab(h-hx-1);:return
  174. 1080 rem
  175. 1090 poke204,0
  176. 1095 getan$:ifan$=""then1095
  177. 1100 ifan$="y"oran$="[217]"thenpoke2040,1:return
  178. 1102 ifan$="n"oran$="[206]"thenpoke2040,1:return
  179. 1104 poke54276,65:poke54276,64:goto1090
  180. 1110 ifasc(an$)=27thenesc=1
  181. 1130 rem
  182. 1140 forzz=1tolen(m$):printtab(38)mid$(m$,zz,1):print"[145] ";:ifsf=1thennext:print:return
  183. 1141 poke54283,129:poke54283,128:forl=1to20:nextl,zz:print:return
  184. 1150 rem
  185. 1160 poke214,19:print:print"[150][201][204][204][197][199][193][204] [197][206][212][210][217] - [212][210][217] [193][199][193][201][206]!";
  186. 1165 poke54276,33:poke54276,32:fort=1to1000:next:return
  187. 1170 rem
  188. 1180 rem
  189. 1190 forl=0tonl:poke214,sl-1:print"[145]":sys49152:nextl:return
  190. 1200 rem
  191. 1210 rem
  192. 1220 print"#  [195]ompany [206]ame    [200]igh [204]ow [195]urr [197]r/sh"
  193. 1230 forc=1tonc
  194. 1231 poke214,3+c:print""c;
  195. 1232 printtab(4)"[129]"cn$(c);
  196. 1233 printtab(21)"[153]"hp$(c);
  197. 1234 printtab(25)"[150]"lp$(c);:hx=len(str$(sp(d,c)))
  198. 1235 printtab(33-hx)"[158]"sp(d,c);
  199. 1236 printtab(34)"[154]"ep$(c)
  200. 1240 next:return
  201. 1250 rem
  202. 1260 iftv(c)>10000thencr=.009:goto1280
  203. 1270 cr=.10-.025*(tv(c))^.14
  204. 1280 com(c)=int(cr*tv(c))
  205. 1290 ifcom(c)>0andcom(c)<30thencom(c)=30
  206. 1300 return
  207. 1310 rem
  208. 1320 sel=int(1+10*rnd(1)/vb(c))
  209. 1330 sm$(1)=" reports drop in earnings"
  210. 1332 sm$(2)=" loses major customer"
  211. 1334 sm$(3)=" loses $1.5 million"
  212. 1336 sm$(4)=" fires the [208]resident"
  213. 1338 sm$(5)=" filed for [194]ankruptcy !!!"
  214. 1340 v(1)=-1:v(2)=-1.5:v(3)=-2:v(4)=.5:v(5)=-3
  215. 1342 nv(c)=v(sel):nm$(d,c)=sm$(sel):return
  216. 1350 rem
  217. 1360 sel=int(1+10*rnd(1)/vg(c))
  218. 1370 sm$(1)=" reports earnings increase"
  219. 1371 sm$(2)=" reports earnings double"
  220. 1372 sm$(3)=" reports sales increase"
  221. 1373 sm$(4)=" acquires major customers"
  222. 1380 sm$(5)=" cuts costs by $10,000,000"
  223. 1390 v(1)=2:v(2)=5:v(3)=3:v(4)=2.5:v(5)=2
  224. 1392 nv(c)=v(sel): nm$(d,c)=sm$(sel): return
  225. 1400 rem
  226. 1410 mt=2:gosub 920
  227. 1412 print"#  [195]ompany [206]ame  [208]/[211] x #[211]hrs = [212]ot [214]al"
  228. 1420 forc=1to7:
  229. 1422 poke214,(3+c):print"[154]"c;
  230. 1424 printtab(5)"[129]"cn$(c);
  231. 1426 h=22:a=sp(0,c):gosub1060:print"[158]"a
  232. 1430 next:poke214,14:print"[145]":print "[197]nter number of shares you wish to buy"
  233. 1432 print"or enter zero (0) not to buy a stock"
  234. 1434 print"and press [[210][197][212][213][210][206]] after each entry."
  235. 1440 tt=0:com=0
  236. 1442 forc=1to7
  237. 1444 poke214,3+c:print"[145]":printtab(24)"[156]";:bs=7:gosub1700:xs$(c)=wq$
  238. 1446 xs(c)=val(xs$(c))
  239. 1448 if(xs(c)>-1)and(xs(c)<1000000)thengoto1460
  240. 1450 gosub1150:sl=21:nl=1:gosub1170:c=c-1:goto1500
  241. 1460 tv(c)=xs(c)*sp(d,c):
  242. 1462 poke214,3+c:print"[145]":h=40:a=tv(c):gosub1060:print""a
  243. 1464 gosub1250:tt=tt+tv(c)
  244. 1470 sl=13:nl=1:gosub 1170
  245. 1472 poke214,12:print"[145]":printtab(13)"[149][212]otal transaction:[159]";
  246. 1474 h=40:a=tt:gosub1060:print a
  247. 1476 tc(d)=tc(d)-tv(c)-com(c):com=com+com(c)
  248. 1480 if tc(d)>0 then goto 1510
  249. 1490 print""
  250. 1491 print"[150][217][207][213] [200][193][214][197] [197][216][195][197][197][196][197][196] [217][207][213][210] [195][193][211][200] [204][201][205][201][212]!";:poke54276,17:poke54276,16
  251. 1492 fort=1to2000:next
  252. 1493 sl=21:nl=1:gosub1170
  253. 1494 tt=tt-tv(c):tc(d)=tc(d)+tv(c)+com(c):com=com-com(c):c=c-1
  254. 1500 poke214,3+c:print:printtab(22);:sys49152:goto1530
  255. 1510 ifd=0thenns(c)=0
  256. 1520 ns(c)=ns(c)+xs(c):ns$(c)=str$(ns(c)):xs(c)=0
  257. 1530 next:print""tab(15)"[208]lease wait..."
  258. 1532 fort=1to1000:next
  259. 1534 return
  260. 1540 rem
  261. 1550 mt=2:gosub920
  262. 1552 print"#  [195]ompany [206]ame  [208]/[211] x #[211]hrs = [212]ot [214]al"
  263. 1560 forc=1to7
  264. 1561 print""c;
  265. 1562 printtab(4)"[129]"cn$(c);:h=22:a=sp(0,c):gosub1060:print"[158]"a
  266. 1570 next:poke214,13:print:print"[197]nter number of shares you wish to sell"
  267. 1572 print"or enter zero (0) not to sell a stock"
  268. 1574 print"and press [[210][197][212][213][210][206]] after each entry."
  269. 1580 tt=0:com=0
  270. 1582 forc=1to7
  271. 1583 poke214,3+c:print"[145]":printtab(23)"[156] ";:bs=7:gosub1700:xs$(c)=wq$
  272. 1584 xs(c)=val(xs$(c)):if(xs(c)>-1)and(xs(c)<1000000)thengoto1600
  273. 1590 gosub1150:sl=21:nl=1:gosub 1170:c=c-1:goto1640
  274. 1600 tv(c)=xs(c)*sp(d,c)
  275. 1602 poke214,3+c:print"[145]":h=40:a=tv(c):gosub1060:print""a
  276. 1604 gosub1250:tt=tt+tv(c)
  277. 1610 sl=13:nl=1:gosub1170
  278. 1612 poke214,12:print"[145]":printtab(12)"[149][212]otal transaction:";
  279. 1614 h=40:a=tt:gosub 1060
  280. 1615 print"[159]"a: tc(d)=tc(d)+tv(c)-com(c): com=com+com(c)
  281. 1620 if xs(c)<=ns(c) then goto 1650
  282. 1630 poke214,20:print:print"[150][217][207][213]'[210][197] [211][197][204][204][201][206][199] [205][207][210][197] [211][200][193][210][197][211] [212][200][193][206] [217][207][213] [207][215][206][146]"
  283. 1632 poke54276,17:poke54276,16
  284. 1634 fort=1to2000:next
  285. 1636 sl=22:nl=1:gosub1170:tt=tt-tv(c)
  286. 1638 tc(d)=tc(d)-tv(c)+com(c):com=com-com(c):c=c-1
  287. 1640 poke214,4+c:print"[145]":printtab(23);:sys49152:goto1660
  288. 1650 ns(c)=ns(c)-xs(c):ns$(c)=str$(ns(c)):xs(c)=0
  289. 1660 next:poke214,20:print"[145]":m$="[208]lease wait...[146]":gosub1040
  290. 1662 fort=1to1000:next
  291. 1664 return
  292. 1700 wq$="":poke204,0
  293. 1705 print"[166][157]";
  294. 1710 getqw$:if(qw$="")or qw$=chr$(34) then1710
  295. 1720 ifqw$=chr$(13)thenpoke204,255:print" ":return
  296. 1730 ifqw$=chr$(20)andwq$<>""thenprintqw$;:wq$=left$(wq$,len(wq$)-1):goto1705
  297. 1740 ifqw$<" "then1710
  298. 1750 iflen(wq$)>bsthen1705
  299. 1760 ifqw$>chr$(127)andqw$<chr$(160)then1705
  300. 1765 printqw$;:wq$=wq$+qw$:goto1705
  301. 1780 poke54273,50:poke54276,65:poke54276,64:forl=1to100:nextl:poke54273,25:return
  302.